package com.xyzim.firstcode.base;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

public class ActivityCollect {

    public static List<Activity> lst = new ArrayList<>();
    public static void addActivty(Activity activity){
        lst.add(activity);
    }

    public static void removeActivity(Activity activity){
        lst.remove(activity);
    }

    public static void finishALl(){
        for(Activity activity:lst){
            if(!activity.isFinishing()){
                activity.finish();
            }
        }
    }
}
